//
// Created by Langingsing on 2021/10/24.
//
#include <iostream>

#include "Coordinate.h"
#include "Map.h"
#include "Queue.h"
#include "Stack.h"

using namespace std;

void map_demo()
{
    Map<int> m(3, 4);

    for (size_t col = 0; col < m.cols(); ++col)
        for (size_t row = 0; row < m.rows(); ++row)
            m.val(col, row, int(col * 10 + row));

    cout << "hello test" << endl;
    cout << m << endl;
}

void queue_demo()
{
    Queue<int> s;
    s.push(1);
    cout << s.pop() << endl;
    s.push(2);

    cout << s.pop() << endl;
    s.push(3);
    cout << s.pop() << endl;
}

void stack_demo()
{
    Stack<Coord<long long>> s;

    s.push({0, 100});
    s.push({100, 110});

    cout << s.top() + *s.basePtr() << endl;

    while (!s.empty())
        cout << s.pop() << endl;
}

int main()
{
    cout << "map demo" << endl;
    map_demo();
    cout << endl;

    cout << "queue demo" << endl;
    queue_demo();
    cout << endl;

    cout << "stack & coordinate demo" << endl;
    stack_demo();

    return 0;
}